﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
namespace Data
{
    public class LoaiDocGiaRepository
    {
        public static List<LoaiDocGiaDTO> GetData()
        {
            List<LoaiDocGiaDTO> list = new List<LoaiDocGiaDTO>();
            try
            {
                QLTVDataContext context = new QLTVDataContext();
                var query = from ldg in context.LOAIDOCGIAs
                            select ldg;
                foreach (var ldg in query)
                {
                    LoaiDocGiaDTO loaidocgiaDTO = new LoaiDocGiaDTO();
                    loaidocgiaDTO.MaLoaiDocGia = ldg.MALOAIDOCGIA;
                    loaidocgiaDTO.TenLoaiDocGia = ldg.TENLOAIDOCGIA;
                    list.Add(loaidocgiaDTO);
                }
            }
            catch (System.Exception)
            {
 
            }
            return list;
        }
    }
}
